package com.hbt.myplus.config;

import com.hbt.myplus.auth.jwt.JWTInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class MyWebMvcConfigurer implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new JWTInterceptor())
                .addPathPatterns("/**")// 其他非登录接口都需要进行token验证
                .excludePathPatterns("/doctor/login", "/doctor/all","/api/doctor/all", "/pet/own/login", "/index.html/**");// 登录接口不用于token验证
//                .excludePathPatterns("/doctor/login");// 登录接口不用于token验证

    }
}